<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
        <ul id="list">
           <li>1</li>
           <li>2</li>
           <li>3</li>
        </ul>
        <script>
            const lis = document.querySelector('#list li');
            console.log(lis);
            /* lis.addEventListener('click',function(){
                console.log('------')
            }) */
          /*  for(let i = 0;i<lis.length;i++) {
            lis[i].addEventLister('click',function(){
                console.log(this.innerHTML)
            })
           } */
          document.getElementById('list').addEventListener('click',function(){
            // li 任何一个都会触发 n个li事件节省为 1 个
            console.log('------');
          })
        </script>
</body>
</html>